package borge.web.teamspirit.client.page.shared.textinput;


import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RichTextArea;
import com.google.gwt.user.client.ui.VerticalPanel;

public class WriteCommentDialog extends DialogBox {
	
	private RichTextArea iTextArea;
	private RichTextToolbar iToolbar;
	private Button iCancel;
	private Button iPost;
	private DockPanel iPanel;
	
	public WriteCommentDialog(){
		
		iPanel = new DockPanel();
		iTextArea = new RichTextArea();
		iToolbar = new RichTextToolbar(iTextArea);
		iCancel = new Button();
		iPost = new Button();
		
		iTextArea.setWidth("100%");
		iToolbar.setWidth("100%");
		
		iCancel.setText("Cancel");
		iPost.setText("Post");
		iCancel.addClickHandler(new ClickHandler(){

			@Override
			public void onClick(ClickEvent event) {
				// TODO Auto-generated method stub
				hide();
			}
			
		});
		
		iPost.addClickHandler(new ClickHandler(){

			@Override
			public void onClick(ClickEvent event) {
				// TODO Auto-generated method stub
				hide();
			}
			
		});
		
		iPanel.add(iToolbar, DockPanel.NORTH);
		iPanel.add(iTextArea, DockPanel.CENTER);
		HorizontalPanel southPanel = new HorizontalPanel();
		southPanel.add(iCancel);
		southPanel.add(iPost);
		iPanel.add(southPanel, DockPanel.SOUTH);
		
		
		setText("Write a comment");
		setWidget(iPanel);
		center();
		show();
	}
	

}
